#include <stdlib.h>
#include <string.h>
#include <sys/select.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <arpa/inet.h>
#include <unistd.h>
#include <sys/un.h>

conectarConsolaConPPD() {
#define path_socket_unix "/home/utn_so/miSocketUnix"

int descriptor = socket(AF_UNIX, SOCK_STREAM, 0);

struct sockaddr_un *local_address = malloc(sizeof(struct sockaddr_un));
struct sockaddr_un *remote_address = malloc(sizeof(struct sockaddr_un));

local_address->sun_family = AF_UNIX;
strncpy(local_address->sun_path, path_socket_unix, sizeof(local_address->sun_path));

bind(descriptor, (struct sockaddr *)local_address, sizeof(struct sockaddr_un));

remote_address->sun_family = AF_UNIX;
strncpy(remote_address->sun_path, "/home/utn_so/miSocketUnix", sizeof(remote_address->sun_path));

connect(descriptor, (struct sockaddr *)remote_address , sizeof(struct sockaddr_un));

}

